# -*- coding: utf-8 -*-
# @Time    : 2021/4/15 9:34
# @Author  : lilehao
# @Email   : 2811894942@qq.com
# @File    : 0414作业.py

import random
import string
N = input("您需要几个激活码：")
def activation_code(N):
    """
    生成激活码
    :param N:
    :return:
    """
    with open("lilehao.txt", mode="a", encoding="utf-8") as fp:
        for i in range(N):
            str1 = "".join(random.sample(string.digits + string.ascii_uppercase, 32))
            print(str1)
            fp.write(str1 + "\n")

if N.isdigit():
    N = int(N)
    activation_code(N)
else:
    print("您的输入有误")

